﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="notify_manage_list.aspx.cs" Inherits="Ccit.OA.Notify.notify_manage_list"   culture="auto" meta:resourcekey="PageResource1" uiculture="auto"%>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.1" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v8.1" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>通知管理-通知发布</title>
    <script language="javascript" type="text/javascript" src="../script/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="../script/StringClass_Ext.js"></script>
    <script language="javascript" type="text/javascript" src="../script/jsonlib.js"></script>
    <script language="javascript" src="../script/jwindow.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jcontrol.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
    <script type="text/javascript">
        function DoAdd()
        {
            var strUrl = "notify_manage_edit.aspx";
            window.location.href = strUrl;
        }
        function DoEdIt(vsRecid)
        {
            var vPageParam = "NotifyId="+vsRecid;
            var encodeParam = base64encode(vPageParam);
            var strUrl = "notify_manage_edit.aspx?"+encodeParam;
            window.location.href = strUrl;
        }
        function DoReply(vsRecid)
        {
            var vPageParam = "NotifyId="+vsRecid;
            var encodeParam = base64encode(vPageParam);
            var strUrl = "notify_reply_list.aspx?"+encodeParam;
            OpenWindow(strUrl,"","800","600");
        }
        function DoOpenQuery(vType)
        {
            var vPageParam = "Type="+vType;
            var encodeParam = base64encode(vPageParam);
            var strUrl = "notify_manage_query.aspx?"+encodeParam;
            window.location.href = strUrl;
        }
        function Operate(vsRecId,vState,type)
        { 
             if(vsRecId =="0")
             {
                vsRecId = document.getElementById("_hidsRecId").value;
             }
              
             if(vsRecId!="")
             {
                if(vState=="1")
                {
                    if(confirm("是否确定发布该通知?")) 
                        PageMethods.DoOperate(vsRecId,type,vState,ClientCallBack);	
                }
                else
                {
                    if(confirm("取消发布将同时删除浏览记录,是否确定取消该通知?")) 
                        PageMethods.DoOperate(vsRecId,type,vState,ClientCallBack);	
                }
             }
             else
             {
                alert("没有您要发布的数据!");
             }
        }
        function doDelete(vsRecId)
        {
             if(vsRecId=="0")
             {
                vsRecId = document.getElementById("_hidsRecId").value;
             }
             var type="1";
             if(vsRecId!="")
		        {
		            if(confirm("删除当前记录,是否继续?")) 
                        PageMethods.DoOperate(vsRecId,type,"",ClientCallBack);
                }	
                else
                {
                    alert("尚未有您要删除的数据");
                } 
        }
        function ClientCallBack(vResult)
		{ 
		    eval("ObjResult =" +vResult);
		    if(ObjResult.result!="-999")
		    {
		        __doPostBack("lnbQuery","");
		        //alert(ObjResult.message); 
		        return true;
		    }
		    else
		    {
		        //alert(ObjResult.message); 
		        return false;
		    }    		
		}
        //复选框选择
         var objState ; 
        function doDataGridItemSel( obj )
        {
          if ( objState != null )
          {
             objState.style.color = "";
             objState.style.backgroundColor = "";
          } 
          obj.style.color = "#fffeee";
          obj.style.backgroundColor = "#a0a0a0";        
          objState = obj;		                       
        }	
        function OnGridSelectionChanged(){           
            dgMain.GetSelectedFieldValues("id",OnGridSelectionComplete);
        }
        
        function OnGridSelectionComplete(values){
            document.getElementById("_hidsRecId").value=values;            
        }
    </script>
</head>
<body>
    <ccit:ActionForm id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>         
        <input type="hidden" id="_hidsRecId" runat="server" />
        <input type="hidden" id="_hidQuery" runat="server" />
        <table class="tbToolbar" cellpadding="0" cellspacing="0" width="98%" align="center" id="TablePrint">
                <tr>
                    <td align="left">
                        <div class="tbSeparator"></div>
                    </td>
                    <td width="100%" class="titlebar">  
                        通知管理-通知发布
                    </td>                
                    <td align="right">
                        <nobr> 
                            <asp:DropDownList ID="ddlSearch" CssClass="input" runat="server" Width="120"></asp:DropDownList>
                            &nbsp;
                           <asp:LinkButton ID="lnbQuery" CssClass="linktext" runat="server" 
                            onclick="lnbQuery_Click1"  >
						        <img src="../images/toolbar/search.gif" border="0">查询
					        </asp:LinkButton>
					        <a  id="lndDelete" Runat="server" class="linktext"  
                            href="javascript:DoOpenQuery('1')">
						        <img src="../images/toolbar/preview.gif" border="0">条件设置
					        </a> 
					        <a  id="lndAllDelete" Runat="server" class="linktext"  
                            href="javascript:DoAdd()">
						        <img src="../images/toolbar/addnew_bq.gif" border="0">新增
					        </a> 
					          <a  id="A1" Runat="server" class="linktext"  
                            href="javascript:Operate('0','1','0')"> 
						        <img src="../images/toolbar/setgeneral.gif" border="0">发布
					        </a> 
					          <a  id="A2" Runat="server" class="linktext"  
                            href="javascript:doDelete('0')">
						        <img src="../images/toolbar/delete.gif" border="0">删除
					        </a> 
					        
                         </nobr>
                    </td> 
                </tr>
      </table>
      <table cellpadding="0" cellspacing="0" width="98%" align="center">
                                <tr>
                                    <td colspan="3" width="100%">
                                      <dxwgv:ASPxGridView ID="dgMain" runat="server"
                                AutoGenerateColumns="False" Width="100%" KeyFieldName="id" onhtmlrowcreated="dgMain_HtmlRowCreated"   
                                             >
                                            <SettingsPager AlwaysShowPager="True" PageSize="15">
                                                <FirstPageButton Visible="True">
                                                </FirstPageButton>
                                                <LastPageButton Visible="True">
                                                </LastPageButton>
                                            </SettingsPager>
                                             <Styles>
                                                <Row CssClass=""></Row>
                                                <AlternatingRow  CssClass="" Enabled="true"/>
                                                <SelectedRow  CssClass=""></SelectedRow>                
                                            </Styles>  
                                            <Columns>
                                                 <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Width="2%">
                                                    <HeaderTemplate>
                                                        <input type="checkbox" id="chbCheck" runat="server" onclick="dgMain.SelectAllRowsOnPage(this.checked);"
                                                            style="vertical-align: middle;" title="Select/Unselect all rows on the page"></input>
                                                    </HeaderTemplate>
                                                    <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" HorizontalAlign="Center">
                                                        <Paddings PaddingTop="1px" PaddingBottom="1px"></Paddings>
                                                    </HeaderStyle>
                                                </dxwgv:GridViewCommandColumn>
                                                <dxwgv:GridViewDataTextColumn Caption="通知标题" VisibleIndex="1" width="12%" FieldName="title">
                                                 <HeaderStyle HorizontalAlign="Center" />
                                                 <CellStyle HorizontalAlign="left"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn>
                                                <dxwgv:GridViewDataTextColumn Caption="重要程度" VisibleIndex="2" width="8%" FieldName="importance">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="Center"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn>
                                                 <dxwgv:GridViewDataTextColumn Caption="通知类型" VisibleIndex="3" width="12%" FieldName="type">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="Center"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn>
                                                 <dxwgv:GridViewDataTextColumn Caption="发布部门" VisibleIndex="4" width="10%" FieldName="deptname">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="Center"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn> 
                                                  <dxwgv:GridViewDataTextColumn Caption="发布时间" VisibleIndex="5" width="12%" FieldName="releasetime">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="Center"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn> 
                                                  <dxwgv:GridViewDataTextColumn Caption="通知回复" VisibleIndex="6" width="8%" FieldName="ucount">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="Center"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn> 
                                                  <dxwgv:GridViewDataTextColumn Caption="发布标志" VisibleIndex="7" width="10%" FieldName="state">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="Center"></CellStyle>
                                                </dxwgv:GridViewDataTextColumn> 
                                                 <dxwgv:GridViewDataTextColumn Caption="操作" VisibleIndex="8" width="4%">
                                                  <HeaderStyle HorizontalAlign="Center" />
                                                  <CellStyle HorizontalAlign="Center"></CellStyle>
                                                   <DataItemTemplate>
                                                   <nobr> 
                                                        <a id="lnbEdit" runat="server">编辑</a>  
                                                        <a id="lnbDel" runat="server">删除</a>  
                                                        </nobr>
                                                   </DataItemTemplate>
                                                </dxwgv:GridViewDataTextColumn>
                                            </Columns>
                                             <%-- 复选框选择脚本事件 --%>
                                                    <ClientSideEvents SelectionChanged="function(s,e){OnGridSelectionChanged();}" />
                                        </dxwgv:ASPxGridView>
                                    </td>
                                </tr>
                            </table>
    </ccit:ActionForm>
</body>
</html>
